3.374 \(\int x^2 (d+e x^r) (a+b \log (c x^n)) \, dx\)

Optimal. Leaf size=59 \[ \frac{1}{3} \left (d x^3+\frac{3 e x^{r+3}}{r+3}\right ) \left (a+b \log \left (c x^n\right )\right )-\frac{1}{9} b d n x^3-\frac{b e n x^{r+3}}{(r+3)^2} \]

[Out]

-(b*d*n*x^3)/9 - (b*e*n*x^(3 + r))/(3 + r)^2 + ((d*x^3 + (3*e*x^(3 + r))/(3 + r))*(a + b*Log[c*x^n]))/3

________________________________________________________________________________________

Rubi [A]  time = 0.0804727, antiderivative size = 59, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.143, Rules used = {14, 2334, 12} \[ \frac{1}{3} \left (d x^3+\frac{3 e x^{r+3}}{r+3}\right ) \left (a+b \log \left (c x^n\right )\right )-\frac{1}{9} b d n x^3-\frac{b e n x^{r+3}}{(r+3)^2} \]

Antiderivative was successfully verified.

[In]

Int[x^2*(d + e*x^r)*(a + b*Log[c*x^n]),x]

[Out]

-(b*d*n*x^3)/9 - (b*e*n*x^(3 + r))/(3 + r)^2 + ((d*x^3 + (3*e*x^(3 + r))/(3 + r))*(a + b*Log[c*x^n]))/3

Rule 14

Int[(u_)*((c_.)*(x_))^(m_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*u, x], x] /; FreeQ[{c, m}, x] && SumQ[u]
 &&  !LinearQ[u, x] &&  !MatchQ[u, (a_) + (b_.)*(v_) /; FreeQ[{a, b}, x] && InverseFunctionQ[v]]

Rule 2334

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))*(x_)^(m_.)*((d_) + (e_.)*(x_)^(r_.))^(q_.), x_Symbol] :> With[{u = I
ntHide[x^m*(d + e*x^r)^q, x]}, Simp[u*(a + b*Log[c*x^n]), x] - Dist[b*n, Int[SimplifyIntegrand[u/x, x], x], x]
] /; FreeQ[{a, b, c, d, e, n, r}, x] && IGtQ[q, 0] && IntegerQ[m] &&  !(EqQ[q, 1] && EqQ[m, -1])

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rubi steps

\begin{align*} \int x^2 \left (d+e x^r\right ) \left (a+b \log \left (c x^n\right )\right ) \, dx &=\frac{1}{3} \left (d x^3+\frac{3 e x^{3+r}}{3+r}\right ) \left (a+b \log \left (c x^n\right )\right )-(b n) \int \frac{1}{3} x^2 \left (d+\frac{3 e x^r}{3+r}\right ) \, dx\\ &=\frac{1}{3} \left (d x^3+\frac{3 e x^{3+r}}{3+r}\right ) \left (a+b \log \left (c x^n\right )\right )-\frac{1}{3} (b n) \int x^2 \left (d+\frac{3 e x^r}{3+r}\right ) \, dx\\ &=\frac{1}{3} \left (d x^3+\frac{3 e x^{3+r}}{3+r}\right ) \left (a+b \log \left (c x^n\right )\right )-\frac{1}{3} (b n) \int \left (d x^2+\frac{3 e x^{2+r}}{3+r}\right ) \, dx\\ &=-\frac{1}{9} b d n x^3-\frac{b e n x^{3+r}}{(3+r)^2}+\frac{1}{3} \left (d x^3+\frac{3 e x^{3+r}}{3+r}\right ) \left (a+b \log \left (c x^n\right )\right )\\ \end{align*}

Mathematica [A]  time = 0.0881946, size = 73, normalized size = 1.24 \[ \frac{x^3 \left (3 a (r+3) \left (d (r+3)+3 e x^r\right )+3 b (r+3) \log \left (c x^n\right ) \left (d (r+3)+3 e x^r\right )-b n \left (d (r+3)^2+9 e x^r\right )\right )}{9 (r+3)^2} \]

Antiderivative was successfully verified.

[In]

Integrate[x^2*(d + e*x^r)*(a + b*Log[c*x^n]),x]

[Out]

(x^3*(3*a*(3 + r)*(d*(3 + r) + 3*e*x^r) - b*n*(d*(3 + r)^2 + 9*e*x^r) + 3*b*(3 + r)*(d*(3 + r) + 3*e*x^r)*Log[
c*x^n]))/(9*(3 + r)^2)

________________________________________________________________________________________

Maple [C]  time = 0.237, size = 614, normalized size = 10.4 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x^2*(d+e*x^r)*(a+b*ln(c*x^n)),x)

[Out]

1/3*b*x^3*(d*r+3*e*x^r+3*d)/(3+r)*ln(x^n)-1/18*x^3*(-54*a*d+18*I*Pi*b*d*r*csgn(I*x^n)*csgn(I*c*x^n)*csgn(I*c)-
18*x^r*a*e*r+18*x^r*b*e*n-9*I*Pi*b*e*csgn(I*c*x^n)^2*csgn(I*c)*x^r*r-9*I*Pi*b*e*csgn(I*x^n)*csgn(I*c*x^n)^2*x^
r*r+12*b*d*n*r+18*b*d*n-54*x^r*a*e-36*ln(c)*b*d*r-6*ln(c)*b*d*r^2-18*ln(c)*b*e*x^r*r-54*ln(c)*b*e*x^r+27*I*Pi*
b*e*csgn(I*x^n)*csgn(I*c*x^n)*csgn(I*c)*x^r-6*a*d*r^2-54*ln(c)*b*d-36*a*d*r+27*I*Pi*b*d*csgn(I*c*x^n)^3+2*b*d*
n*r^2+3*I*Pi*b*d*r^2*csgn(I*x^n)*csgn(I*c*x^n)*csgn(I*c)-27*I*Pi*b*d*csgn(I*c*x^n)^2*csgn(I*c)+3*I*Pi*b*d*r^2*
csgn(I*c*x^n)^3+18*I*Pi*b*d*csgn(I*c*x^n)^3*r-27*I*Pi*b*d*csgn(I*x^n)*csgn(I*c*x^n)^2+27*I*Pi*b*e*csgn(I*c*x^n
)^3*x^r+9*I*Pi*b*e*csgn(I*x^n)*csgn(I*c*x^n)*csgn(I*c)*x^r*r-18*I*Pi*b*d*r*csgn(I*x^n)*csgn(I*c*x^n)^2-18*I*Pi
*b*d*r*csgn(I*c*x^n)^2*csgn(I*c)+9*I*Pi*b*e*csgn(I*c*x^n)^3*x^r*r-27*I*Pi*b*e*csgn(I*c*x^n)^2*csgn(I*c)*x^r+27
*I*Pi*b*d*csgn(I*x^n)*csgn(I*c*x^n)*csgn(I*c)-3*I*Pi*b*d*r^2*csgn(I*c*x^n)^2*csgn(I*c)-27*I*Pi*b*e*csgn(I*x^n)
*csgn(I*c*x^n)^2*x^r-3*I*Pi*b*d*r^2*csgn(I*x^n)*csgn(I*c*x^n)^2)/(3+r)^2

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^2*(d+e*x^r)*(a+b*log(c*x^n)),x, algorithm="maxima")

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [B]  time = 1.32176, size = 381, normalized size = 6.46 \begin{align*} \frac{3 \,{\left (b d r^{2} + 6 \, b d r + 9 \, b d\right )} x^{3} \log \left (c\right ) + 3 \,{\left (b d n r^{2} + 6 \, b d n r + 9 \, b d n\right )} x^{3} \log \left (x\right ) -{\left (9 \, b d n +{\left (b d n - 3 \, a d\right )} r^{2} - 27 \, a d + 6 \,{\left (b d n - 3 \, a d\right )} r\right )} x^{3} + 9 \,{\left ({\left (b e r + 3 \, b e\right )} x^{3} \log \left (c\right ) +{\left (b e n r + 3 \, b e n\right )} x^{3} \log \left (x\right ) -{\left (b e n - a e r - 3 \, a e\right )} x^{3}\right )} x^{r}}{9 \,{\left (r^{2} + 6 \, r + 9\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^2*(d+e*x^r)*(a+b*log(c*x^n)),x, algorithm="fricas")

[Out]

1/9*(3*(b*d*r^2 + 6*b*d*r + 9*b*d)*x^3*log(c) + 3*(b*d*n*r^2 + 6*b*d*n*r + 9*b*d*n)*x^3*log(x) - (9*b*d*n + (b
*d*n - 3*a*d)*r^2 - 27*a*d + 6*(b*d*n - 3*a*d)*r)*x^3 + 9*((b*e*r + 3*b*e)*x^3*log(c) + (b*e*n*r + 3*b*e*n)*x^
3*log(x) - (b*e*n - a*e*r - 3*a*e)*x^3)*x^r)/(r^2 + 6*r + 9)

________________________________________________________________________________________

Sympy [A]  time = 19.1895, size = 525, normalized size = 8.9 \begin{align*} \begin{cases} \frac{3 a d r^{2} x^{3}}{9 r^{2} + 54 r + 81} + \frac{18 a d r x^{3}}{9 r^{2} + 54 r + 81} + \frac{27 a d x^{3}}{9 r^{2} + 54 r + 81} + \frac{9 a e r x^{3} x^{r}}{9 r^{2} + 54 r + 81} + \frac{27 a e x^{3} x^{r}}{9 r^{2} + 54 r + 81} + \frac{3 b d n r^{2} x^{3} \log{\left (x \right )}}{9 r^{2} + 54 r + 81} - \frac{b d n r^{2} x^{3}}{9 r^{2} + 54 r + 81} + \frac{18 b d n r x^{3} \log{\left (x \right )}}{9 r^{2} + 54 r + 81} - \frac{6 b d n r x^{3}}{9 r^{2} + 54 r + 81} + \frac{27 b d n x^{3} \log{\left (x \right )}}{9 r^{2} + 54 r + 81} - \frac{9 b d n x^{3}}{9 r^{2} + 54 r + 81} + \frac{3 b d r^{2} x^{3} \log{\left (c \right )}}{9 r^{2} + 54 r + 81} + \frac{18 b d r x^{3} \log{\left (c \right )}}{9 r^{2} + 54 r + 81} + \frac{27 b d x^{3} \log{\left (c \right )}}{9 r^{2} + 54 r + 81} + \frac{9 b e n r x^{3} x^{r} \log{\left (x \right )}}{9 r^{2} + 54 r + 81} + \frac{27 b e n x^{3} x^{r} \log{\left (x \right )}}{9 r^{2} + 54 r + 81} - \frac{9 b e n x^{3} x^{r}}{9 r^{2} + 54 r + 81} + \frac{9 b e r x^{3} x^{r} \log{\left (c \right )}}{9 r^{2} + 54 r + 81} + \frac{27 b e x^{3} x^{r} \log{\left (c \right )}}{9 r^{2} + 54 r + 81} & \text{for}\: r \neq -3 \\\frac{a d x^{3}}{3} + a e \log{\left (x \right )} + \frac{b d n x^{3} \log{\left (x \right )}}{3} - \frac{b d n x^{3}}{9} + \frac{b d x^{3} \log{\left (c \right )}}{3} + \frac{b e n \log{\left (x \right )}^{2}}{2} + b e \log{\left (c \right )} \log{\left (x \right )} & \text{otherwise} \end{cases} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x**2*(d+e*x**r)*(a+b*ln(c*x**n)),x)

[Out]

Piecewise((3*a*d*r**2*x**3/(9*r**2 + 54*r + 81) + 18*a*d*r*x**3/(9*r**2 + 54*r + 81) + 27*a*d*x**3/(9*r**2 + 5
4*r + 81) + 9*a*e*r*x**3*x**r/(9*r**2 + 54*r + 81) + 27*a*e*x**3*x**r/(9*r**2 + 54*r + 81) + 3*b*d*n*r**2*x**3
*log(x)/(9*r**2 + 54*r + 81) - b*d*n*r**2*x**3/(9*r**2 + 54*r + 81) + 18*b*d*n*r*x**3*log(x)/(9*r**2 + 54*r +
81) - 6*b*d*n*r*x**3/(9*r**2 + 54*r + 81) + 27*b*d*n*x**3*log(x)/(9*r**2 + 54*r + 81) - 9*b*d*n*x**3/(9*r**2 +
 54*r + 81) + 3*b*d*r**2*x**3*log(c)/(9*r**2 + 54*r + 81) + 18*b*d*r*x**3*log(c)/(9*r**2 + 54*r + 81) + 27*b*d
*x**3*log(c)/(9*r**2 + 54*r + 81) + 9*b*e*n*r*x**3*x**r*log(x)/(9*r**2 + 54*r + 81) + 27*b*e*n*x**3*x**r*log(x
)/(9*r**2 + 54*r + 81) - 9*b*e*n*x**3*x**r/(9*r**2 + 54*r + 81) + 9*b*e*r*x**3*x**r*log(c)/(9*r**2 + 54*r + 81
) + 27*b*e*x**3*x**r*log(c)/(9*r**2 + 54*r + 81), Ne(r, -3)), (a*d*x**3/3 + a*e*log(x) + b*d*n*x**3*log(x)/3 -
 b*d*n*x**3/9 + b*d*x**3*log(c)/3 + b*e*n*log(x)**2/2 + b*e*log(c)*log(x), True))

________________________________________________________________________________________

Giac [B]  time = 1.31582, size = 185, normalized size = 3.14 \begin{align*} \frac{b n r x^{3} x^{r} e \log \left (x\right )}{r^{2} + 6 \, r + 9} + \frac{1}{3} \, b d n x^{3} \log \left (x\right ) + \frac{3 \, b n x^{3} x^{r} e \log \left (x\right )}{r^{2} + 6 \, r + 9} - \frac{1}{9} \, b d n x^{3} - \frac{b n x^{3} x^{r} e}{r^{2} + 6 \, r + 9} + \frac{1}{3} \, b d x^{3} \log \left (c\right ) + \frac{b x^{3} x^{r} e \log \left (c\right )}{r + 3} + \frac{1}{3} \, a d x^{3} + \frac{a x^{3} x^{r} e}{r + 3} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^2*(d+e*x^r)*(a+b*log(c*x^n)),x, algorithm="giac")

[Out]

b*n*r*x^3*x^r*e*log(x)/(r^2 + 6*r + 9) + 1/3*b*d*n*x^3*log(x) + 3*b*n*x^3*x^r*e*log(x)/(r^2 + 6*r + 9) - 1/9*b
*d*n*x^3 - b*n*x^3*x^r*e/(r^2 + 6*r + 9) + 1/3*b*d*x^3*log(c) + b*x^3*x^r*e*log(c)/(r + 3) + 1/3*a*d*x^3 + a*x
^3*x^r*e/(r + 3)